package com.assjirc.commands;

import com.assjirc.annotations.Command;
import com.assjirc.frames.GUI;
import com.assjirc.irc.IrcManager;

@Command("me")
public class Me implements Executable {

	@Override
	public void execute(String params, GUI gui) {
		if (params != null && !params.trim().equals("")) {
			GUI.getIrcmanager().sendAction(IrcManager.currentChannel.getName(), params);
			gui.getChannelTextArea().append(GUI.prepareAction(GUI.getIrcmanager().getNick(), params));
			IrcManager.currentChannel.appendText(GUI.prepareAction(GUI.getIrcmanager().getNick(), params));
		}
	}

	@Override
	public String getDetailedHelp(String... params) {
		return getSimpleHelp() + ", syntax: /me <some action>";
	}

	@Override
	public String getSimpleHelp() {
		return "sends an action to the current channel/query";
	}

}
